unit oFormConfig;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TfrmConfig = class(TForm)
    txtName: TEdit;
    Label1: TLabel;
    btmCancel: TButton;
    btnSave: TButton;
    procedure btnSaveClick(Sender: TObject);
    procedure btmCancelClick(Sender: TObject);
  private
    { Private declarations }
  public
    function getName:String;
    function ShowModal(paName: String = 'Config'): Integer; overload;
  end;

var
  frmConfig: TfrmConfig;

implementation

{$R *.dfm}

procedure TfrmConfig.btmCancelClick(Sender: TObject);
begin
  ModalResult := -1;
  CloseModal;
end;

procedure TfrmConfig.btnSaveClick(Sender: TObject);
begin
  ModalResult := 1;
  CloseModal;
end;

function TfrmConfig.getName: String;
begin
  Result := txtName.Text;
end;

function TfrmConfig.ShowModal(paName: String): Integer;
begin
  self.Caption := paName;
  result := inherited ShowModal;
end;

end.
